package com.example.ice.coursetable.utils;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

import android.os.Environment;

public class FormatUtil {

	/**
	 * �������ļ��е�����ת�浽vedio�ļ���
	 * @param recAudioFile
	 */
	public static void videoRename(File recAudioFile) {
		String path = Environment.getExternalStorageDirectory()
				.getAbsolutePath()
				+ "/mahc/video/"
				+ "0" + "/";
		String fileName = new SimpleDateFormat("yyyyMMddHHmmss")
				.format(new Date()) + ".3gp";
		File out = new File(path);
		if (!out.exists()) {
			out.mkdirs();
		}
		out = new File(path, fileName);
		if (recAudioFile.exists())
			recAudioFile.renameTo(out);
		
	}
	
	/**
	 * ���Լ�ʱ��������ط���
	 * @param num
	 * @return
	 */
	public static String format(int num){
		
		String s = num + "";
		if (s.length() == 1) {
			s = "0" + s;
		}
		return s;
	}
}
